package all

type DoManage func(string) string

type Memory interface {
	Evict(string) string
}

type FuncManage struct {
	ManageFunc DoManage
}

// Evict 抽象策略
func (m *FuncManage) Evict(s string) string {
	return m.ManageFunc(s)
}

// NewMemoryManage 工厂方法
func NewMemoryManage(f DoManage) *FuncManage {
	return &FuncManage{
		ManageFunc: f,
	}
}
